import ElectronStore from 'electron-store';
interface ColorPrps {
    r: number;
    g: number;
    b: number;
    a: number;
}
interface Storage {
    scrollText: string;
    fontSize: number;
    speed: string;
    color: ColorPrps;
    shadowColor: ColorPrps;
    autoStart: boolean;
    fade: boolean;
}

export const store = new ElectronStore<Storage>({
    name: process.env.NODE_ENV === 'development' ? 'config.dev' : 'config',
    encryptionKey: "12313asdasd",
    schema: {
        scrollText: { type: 'string', default: '跑马灯文字测试' },
        fontSize: { type: 'number', default: 50 },
        speed: { type: "string", default: '5s' },
        color: { type: "object", default: { r: 248, g: 231, b: 21, a: 1 } },
        shadowColor: { type: "object", default: { r: 248, g: 231, b: 21, a: 1 } },
        autoStart: { type: 'boolean', default: true },
        fade: { type: 'boolean', default: false }
    }
});
